/*
 * math-functions.h
 *
 *  Created on: Nov 1, 2014
 *      Author: burek
 */

#ifndef REV4_UTIL_MATH_FUNCTIONS_H_
#define REV4_UTIL_MATH_FUNCTIONS_H_

float RsinLUT(int a);
float RcosLUT(int a);
float RtanLUT(int a);
float RctgLUT(int a);

#ifdef R4_USE_TRIG_LUTS
#include "LUTs/trig.h"
#define Rsin(x) RsinLUT((int)((x) * (6.28318530718f / R4_LUT_VALUES)))
#define Rcos(x) RcosLUT((int)((x) * (6.28318530718f / R4_LUT_VALUES)))
#define Rtan(x) RtanLUT((int)((x) * (6.28318530718f / R4_LUT_VALUES)))
#define Rctg(x) RctgLUT((int)((x) * (6.28318530718f / R4_LUT_VALUES)))
#else
#include <cmath>
#define Rsin sin
#define Rcos cos
#define Rtan tan
#define Rctg ctan
#endif


#endif /* REV4_UTIL_MATH_FUNCTIONS_H_ */
